package str73_klonowanie_obiektow;

import java.io.Serializable;
import java.util.Date;
import java.util.GregorianCalendar;

public class Employee extends SerialClonable {
	private String name;
	private double salary;
	private Date hireDate;
	
	public Employee() {}

	public Employee(String name, double salary, int year, int month, int day) {
		this.name = name;
		this.salary = salary;
		GregorianCalendar calendar = new GregorianCalendar(year, month-1, day);
		this.hireDate = calendar.getTime();
	}

	public String getName() {
		return name;
	}

	public double getSalary() {
		return salary;
	}

	public Date getHireDate() {
		return hireDate;
	}
	
	public void raisesalary(double byPercent) {
		double raise = salary * byPercent / 100;
		salary += raise;
	}

	@Override
	public String toString() {
		return getClass().getSimpleName() + 
				"[name=" + name + 
				",salary=" + salary + 
				",hireDate=" + hireDate + "]";
	}
}
